Skip to content

Remove unnecessary constructor to align with other AutoConfigurations #46239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Jul 2, 2025

No description provided.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 2, 2025
@philwebb
Copy link
Member

philwebb commented Jul 3, 2025

Those are actually intentional and we plan to adopt them more widely (but we're not ready to do that yet so please don't submit a PR :) )

The idea is that the class is public so that it can be excluded, but the constructor is package private to stop folks using or extending them directly because we consider auto-configuration classes to not be public API.

@philwebb philwebb closed this Jul 3, 2025
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 3, 2025
@quaff
Copy link
Contributor Author

quaff commented Jul 8, 2025

@philwebb Is it possible to generate package private constructor by annotation processor?

@philwebb
Copy link
Member

philwebb commented Jul 8, 2025

I think we'd rather just keep it simple and add them manually.

@wilkinsona
Copy link
Member

I thought we'd decided on making them final rather than adding package-private constructors, hence the update to the title of #32883.

@philwebb
Copy link
Member

philwebb commented Jul 8, 2025

I can't remember where we landed. Using final would stop subclassing, using a package private constructor would stop folks delegating. Perhaps it's a step too far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants